<%@ page import="com.hncg.dao.UserDao" %>
<%@ page import="com.hncg.entity.User" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: chongge
  Date: 2024/1/9
  Time: 9:33
  To change this template use File | Settings | File Templates.
--%>
<%--本质是一个类--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table  class="table table-condensed">


    <tr class="success">
        <th>编号</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>日期</th>

    </tr>
    <%
        UserDao userDao = new UserDao();
        List<User> list = userDao.getAllUser();
        for (int i = 0; i < list.size(); i++) {


    %>
    <tr>
        <td><%=list.get(i).getId()%>
        </td>
        <td><%=list.get(i).getName()%>
        </td>
        <td><%=list.get(i).getAge()%>
        </td>
        <td><%=list.get(i).getHiredate()%>
        </td>
        <td>
            <a href="userUpdate.jsp?id=<%=list.get(i).getId()%>">修改</a>|
            <a href="javascript:if(confirm('确认删除吗'))window.location='userDel.jsp?id=<%=list.get(i).getId()%>'">删除</a>
        </td>

    </tr>
    <%--表达式--%>
    <%--<%=list.get(i).getId()%>,<%=list.get(i).getName()%>,<%=list.get(i).getAge()%>,<%=list.get(i).getHiredate()%>--%>

    <%
        }
    %>
</table>
<script>
    function delSure(){

    }
</script>
</body>
</html>
